jQuery(document).on("pagebeforeshow", "[data-role='page'][data-pagemenu='true']", function(){
    var page = jQuery(this);
    var panel = page.find("[data-role='panel']");
    
    // if click the .showMenu button, open the menu
    page.find("a.showMenu").click(function(){
        panel.panel("open");       
    });
    

    // Override default menu item click behavior
    panel.find("a.menu-item-xxx").click(function(){
         $.ajax({
            type: "POST",
            url: "",
            data: {},

            success: function(msg) {
                $.mobile.changePage("", { transition: "slide", reverse: false, changeHash: true });
            },

            error: function(req, status, error) {
                $.mobile.changePage("", { transition: "slide", reverse: false, changeHash: true });
            }
        });
    });
});

